<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * Aluno filter form base class.
 *
 * @package    filters
 * @subpackage Aluno *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseAlunoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nm_aluno'                        => new sfWidgetFormFilterInput(),
      'tp_sexo'                         => new sfWidgetFormFilterInput(),
      'dt_nascimento'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'nm_pai'                          => new sfWidgetFormFilterInput(),
      'nm_mae'                          => new sfWidgetFormFilterInput(),
      'nm_profissao_pai'                => new sfWidgetFormFilterInput(),
      'nm_empresa_pai'                  => new sfWidgetFormFilterInput(),
      'nm_profissao_mae'                => new sfWidgetFormFilterInput(),
      'nm_empresa_mae'                  => new sfWidgetFormFilterInput(),
      'nu_telefone_pai'                 => new sfWidgetFormFilterInput(),
      'nu_telefone_comercial_pai'       => new sfWidgetFormFilterInput(),
      'nu_telefone_celular_pai'         => new sfWidgetFormFilterInput(),
      'dt_nascimento_pai'               => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'nu_telefone_mae'                 => new sfWidgetFormFilterInput(),
      'nu_telefone_comercial_mae'       => new sfWidgetFormFilterInput(),
      'nu_telefone_celular_mae'         => new sfWidgetFormFilterInput(),
      'dt_nascimento_mae'               => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'st_pai'                          => new sfWidgetFormFilterInput(),
      'st_mae'                          => new sfWidgetFormFilterInput(),
      'st_pais_juntos'                  => new sfWidgetFormFilterInput(),
      'ds_naturalidade'                 => new sfWidgetFormFilterInput(),
      'nu_fone_1'                       => new sfWidgetFormFilterInput(),
      'nu_fone_2'                       => new sfWidgetFormFilterInput(),
      'nu_fone_3'                       => new sfWidgetFormFilterInput(),
      'id_dados_responsavel'            => new sfWidgetFormDoctrineChoice(array('model' => 'DadosResponsavel', 'add_empty' => true)),
      'st_transporte_escolar'           => new sfWidgetFormFilterInput(),
      'nm_transporte_escolar'           => new sfWidgetFormFilterInput(),
      'nm_motorista_transporte_escolar' => new sfWidgetFormFilterInput(),
      'nu_telefone_transporte_escolar'  => new sfWidgetFormFilterInput(),
      'st_aluno'                        => new sfWidgetFormFilterInput(),
      'user_id'                         => new sfWidgetFormDoctrineChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => true)),
      'id_endereco'                     => new sfWidgetFormDoctrineChoice(array('model' => 'Endereco', 'add_empty' => true)),
      'slug'                            => new sfWidgetFormFilterInput(),
      'created_at'                      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'updated_at'                      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'deleted'                         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
    ));

    $this->setValidators(array(
      'nm_aluno'                        => new sfValidatorPass(array('required' => false)),
      'tp_sexo'                         => new sfValidatorPass(array('required' => false)),
      'dt_nascimento'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'nm_pai'                          => new sfValidatorPass(array('required' => false)),
      'nm_mae'                          => new sfValidatorPass(array('required' => false)),
      'nm_profissao_pai'                => new sfValidatorPass(array('required' => false)),
      'nm_empresa_pai'                  => new sfValidatorPass(array('required' => false)),
      'nm_profissao_mae'                => new sfValidatorPass(array('required' => false)),
      'nm_empresa_mae'                  => new sfValidatorPass(array('required' => false)),
      'nu_telefone_pai'                 => new sfValidatorPass(array('required' => false)),
      'nu_telefone_comercial_pai'       => new sfValidatorPass(array('required' => false)),
      'nu_telefone_celular_pai'         => new sfValidatorPass(array('required' => false)),
      'dt_nascimento_pai'               => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'nu_telefone_mae'                 => new sfValidatorPass(array('required' => false)),
      'nu_telefone_comercial_mae'       => new sfValidatorPass(array('required' => false)),
      'nu_telefone_celular_mae'         => new sfValidatorPass(array('required' => false)),
      'dt_nascimento_mae'               => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'st_pai'                          => new sfValidatorPass(array('required' => false)),
      'st_mae'                          => new sfValidatorPass(array('required' => false)),
      'st_pais_juntos'                  => new sfValidatorPass(array('required' => false)),
      'ds_naturalidade'                 => new sfValidatorPass(array('required' => false)),
      'nu_fone_1'                       => new sfValidatorPass(array('required' => false)),
      'nu_fone_2'                       => new sfValidatorPass(array('required' => false)),
      'nu_fone_3'                       => new sfValidatorPass(array('required' => false)),
      'id_dados_responsavel'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'DadosResponsavel', 'column' => 'id_dados_responsavel')),
      'st_transporte_escolar'           => new sfValidatorPass(array('required' => false)),
      'nm_transporte_escolar'           => new sfValidatorPass(array('required' => false)),
      'nm_motorista_transporte_escolar' => new sfValidatorPass(array('required' => false)),
      'nu_telefone_transporte_escolar'  => new sfValidatorPass(array('required' => false)),
      'st_aluno'                        => new sfValidatorPass(array('required' => false)),
      'user_id'                         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'sfGuardUserProfile', 'column' => 'user_id')),
      'id_endereco'                     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Endereco', 'column' => 'id_endereco')),
      'slug'                            => new sfValidatorPass(array('required' => false)),
      'created_at'                      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'                      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'deleted'                         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
    ));

    $this->widgetSchema->setNameFormat('aluno_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Aluno';
  }

  public function getFields()
  {
    return array(
      'id_aluno'                        => 'Number',
      'nm_aluno'                        => 'Text',
      'tp_sexo'                         => 'Text',
      'dt_nascimento'                   => 'Date',
      'nm_pai'                          => 'Text',
      'nm_mae'                          => 'Text',
      'nm_profissao_pai'                => 'Text',
      'nm_empresa_pai'                  => 'Text',
      'nm_profissao_mae'                => 'Text',
      'nm_empresa_mae'                  => 'Text',
      'nu_telefone_pai'                 => 'Text',
      'nu_telefone_comercial_pai'       => 'Text',
      'nu_telefone_celular_pai'         => 'Text',
      'dt_nascimento_pai'               => 'Date',
      'nu_telefone_mae'                 => 'Text',
      'nu_telefone_comercial_mae'       => 'Text',
      'nu_telefone_celular_mae'         => 'Text',
      'dt_nascimento_mae'               => 'Date',
      'st_pai'                          => 'Text',
      'st_mae'                          => 'Text',
      'st_pais_juntos'                  => 'Text',
      'ds_naturalidade'                 => 'Text',
      'nu_fone_1'                       => 'Text',
      'nu_fone_2'                       => 'Text',
      'nu_fone_3'                       => 'Text',
      'id_dados_responsavel'            => 'ForeignKey',
      'st_transporte_escolar'           => 'Text',
      'nm_transporte_escolar'           => 'Text',
      'nm_motorista_transporte_escolar' => 'Text',
      'nu_telefone_transporte_escolar'  => 'Text',
      'st_aluno'                        => 'Text',
      'user_id'                         => 'ForeignKey',
      'id_endereco'                     => 'ForeignKey',
      'slug'                            => 'Text',
      'created_at'                      => 'Date',
      'updated_at'                      => 'Date',
      'deleted'                         => 'Boolean',
    );
  }
}